FROM jenkins/inbound-agent:3248.v65ecb_254c298-2 AS agent
USER root
RUN mkdir /tools
ADD apache-maven-3.6.0-bin.tar.gz /tools
COPY settings.xml /tools/apache-maven-3.6.0/conf
ADD jdk-8u381-linux-x64.tar.gz /tools
RUN sed -i 's/JAVA_HOME/JAVA_HOME8/g' /tools/apache-maven-3.6.0/bin/mvn \
  && cat /usr/share/zoneinfo/Asia/Shanghai > /etc/localtime

FROM jenkins/inbound-agent:3248.v65ecb_254c298-2
COPY --from=agent /tools /tools
COPY --from=agent /etc/localtime /etc/localtime
COPY kubectl /usr/bin/kubectl
COPY nerdctl /usr/bin/nerdctl
COPY buildctl /usr/bin/buildctl
ENV MAVEN_HOME=/tools/apache-maven-3.6.0
ENV JAVA_HOME8=/tools/jdk1.8.0_381/
ENV PATH=$MAVEN_HOME/bin:$PATH